You can use your own AppleScript programs which can control Jedit3.0 as macros by registering them in the "Macro" menu of Jedit. By the use of a macro, you can make one bothersome routine you do with Jedit into one custom menu of Jedit.
(For details of Jedit's AppleScript commands, see "Script Manual".)
8.1 Macro Menu
You can execute your AppleScript programs from the "Macro" menu and the "Macro Window (see below)". As each menu item of the menu "Macro" of Jedit3.0 can have sub-menus , you can make a lot of macros and register and classify them as submenus.
To make your own macro, first write the AppleScript program with "Script Editor" and save it as a compiled script file.
Next, place this file into the "Macro Menu Items" folder in the "Jedit3.0" folder.
After this, start your Jedit3.0. Then your script will now appear as a macro in the "Macro" menu and in the "Macro Window".
To make submenus, create a new child folder in the "Macro Menu Items" folder and place your script files in this child folder. (The maximum level of this hierarchy is two. You can not make grandchild folders.)
If you want to view or edit your macro script file, select it from the "Macro" menu with the control key down. Then "Script Editor" will open your macro script file as shown below:
Script Dictionary
To see details of AppleScript commands supported by Jedit3.0,
select the "Script Dictionary" of the menu "Macro". Then the "Jedit3
Dictionary" window will appear as shown below. This information may
be useful if you want to make an AppleScript program which controls
Jedit3.0.
Rebuilding Macro Menus
Even after you add or delete a script file in the "Macro Menu
Items"folder, the contents of the menu "Macro" will not be changed
until you rebuild the menu "Macro". To do this, select the "Update
Macro Menu" of the menu "Macro" If Jedit3.0 is not running when
you change the contents of the "Macro Menu Items" folder, the menu
"Macro" will be updated automatically when you start Jedit3.0 next
time.
Macro Shortcuts
To assign a shortcut key to a certain macro menu, add a "/"followed
by a capital letter that you want to use as a shortcut key at the end
of name of the script file. For example, you can find a script file
named "Calc Selection/E" in the "Macro Menu Items" folder. You can
run this macro by pressing E with the option and command keys
down.
Separators on Macro Menus
To add a line separator in the "Macro" menu, make a dummy ,empty
script file with the name that begins with the character "-".
For example, the following file which contains no script serves as a
separator file that will make a line separator in the menu "Macro".
You can change the position of a separater in the menu by the use of
the "Macro Window" whose explanation you can see below.
8.2 Macro Window
From the "Macro Window", you can not only run the macros in the menu "Macro", but also open them with "Script Editor" to edit them. You can also move the positions of macros in the menu "Macro" by the use of this window. Removal and Addition of macros can also be done by "Drag and Drop" from this window.
To open the "Macro Window", select the "Macro Window" of the menu "Macro". Then a window will appear as shown below:
To run a macro, select the macro you like and double click on it. You can also run the selected macro by pressing the "Run" button.
To edit a macro with "Script Editor", select the name of a macro you like and dobule click on it with the control key down. You can also open a macro with "Script Editor" by the use of the "Edit" button.
A small triangle at the left side of a certain macro item means that this macro has child macros. To show or hide the child macros, click this triangle. To show or hide all child macros in the window at once, click the one of these triangles with the option key down.
Move macros in the "Macro Window"
To change the order of the macros in the "Macro Window", simply
drag the macro item you like to the desired position in the list. The
order of menu items in the "Macro" menu will reflect this change in
this "Macro Window".
Dragging and Dropping Script Files
To add a new menu item to the "Macro" menu, drop a script file you
made onto this "Macro Window". Then the script file will be moved to
the "Macro Menu Items" folder automatically and a new menu item
will appear in the "Macro" menu.
To delete a script file from the "Macro Menu Items" folder , only
drag the macro item you dislike from this "Macro Window" to the
"Trash".
File "MenuOrder.dat"
Jedit3.0 automatically makes the files named "MenuOrder.dat" in the
"Macro Menu Items" folder and in every subfolder. These files
contain the data of the order of the macro items in the
"Macro"menu.
8.3 Contextual Menus
Jedit3.0 is compatible with the contextual menu which is available on MacOS 8 or higher.
To open the contextual menu, click the selected area in your Jedit document with the control key down.
You can add or remove the macro items in the contextual menu in the same way as you do in the "Macro" menu.
To add your new contextual menu item, first write an AppleScript program with "Script Editor" and save it as a compiled script file. Then place this file in the "Context Menu Items" folder of the "Jedit3.0" folder.
After this, start Jedit3.0. Then a new menu item will appear on the contextual menu. If Jedit3.0 is already running, use the"Update Macro Menu" from the "Macro" menu.
Note that the contextual menu can not have submenus and you can neither add a separator nor change the order of items.
8.4 Sample Macros
There are many sample macros that are AppleScript files in the "Jedit3.0" folder. These samples may help you when you write your own scripts.
You can also download the scripts from the Jedit Script Library in our web site. These scripts were contributed by many Jedit users.
http://www.matsumoto.co.jp/
We will welcome your original scripts that can be made public in the Jedit Script Library. Please contact us at: mailto:support@matsumoto.co.jp
Built-in sample macro scripts located in the "Macro Menu Items" folder are as follows.
Calc Selection/E
Calculates the mathematical expression at the line of the cursor.
You can use mathematical expressions that are supported by
AppleScript. The shortcut is "Command"+"Option"+"E".
Written by Mr. Gonzaburou (hiroshi.hirayama@nifty.ne.jp)
Search Internet
Searchs the selected word in the Internet using Sherlock.
The results will be shown in the Sherlock window. You need
MacOS 8.5 or higher.
Count Occurrence
Counts the number of occurrences of a certain word in the document.
Copy to New Doc
Copies the selected area of the current document and pastes it to
the new document.
Written by Mr. Gonzaburou (hiroshi.hirayama@nifty.ne.jp)
Send with Outlook Express
Opens "Outlook Express" and sends the selected area of the document
as an e-mail. If you execute this macro without having selected any
area, the whole document will be sent. For using this macro, you
need to have the mailer application "Outlook Express".
Written by Mr.Tomokazu Hanafusa (t-hana@mh1.117.ne.jp)
Multi-Replace
Finds and replace up to the100 sets of strings at once. You need
the plug-in program "JMultiReplace". You can download it from:
http://www.matsumoto.co.jp/
"JMultiReplace" is a freeware.
Default Style/T
Resets styles (fonts, sizes, colors and faces) of the selected text
area to the default. If you execute this macro without having
selected any area, the changes will affect the styles of what you
type in the future. The shortcut is "Command" + "Option" + "T".
To know or change the default font, select the "Ruler Font..." of the menu "Format".
The default color is shown as the Line Number Color from the "Other Colors..." dialog of
the menu "Format". The default style is the style assigned in the "New Document" panel
of the "Preferences" dialog.
Style Information
Gives you the style information of the first letter of the selected
area. If you execute this macro without having selected any area,
this macro will give you the information of the font, size, style and
color of the current document.
This macro is using the script wriiten by Mr.SHUICHI.T.
Parentheses
Inserts various parentheses at the both ends of the selected text
area.
Programmed by Mr Gonzaburou(hira@aero.kyushu-u.ac.jp).
HTML Open JHTML/H
Opens HTML template plug-in "JHTML." JHTML is an AppleScript
pulg-in for Jedit3.0. You can insert various HTML tags into your
document with a single action or through a special wizard.
The shortcut is "Command" + "Option" + "H".
You can download this plug-in from our web site:
http://www.matsumoto.co.jp/
HTML Open JChecker/J
Opens the HTML validation checker "JChecker". JChecker will check
the spelling of the tags and attributes, the existence of end tags,
their hierarchical structures, and general appearances. It will also
alert you if the document contains tags that are not supported by
certain browser types or versions.
The shortcut is "Command" + "Option" + "J".
JChecker is a shareware, and can be downloaded from:
http://www.matsumoto.co.jp/
HTML View with IE/I
Opens "Internet Explorer" and view the HTML document with
"Internet Explorer". The shortcut is "Command" + "Option" + "I".
HTML View with NN/N
Opens "Netscape Navigator" and view the HTML document with
"Netscape Navigator".
The shortcut is "Command" + "Option" +"N".
Manual Index
Opens the Bookmark "Manual Index". To view the contents of
each index, click each index item.
Script Index
Opens the Bookmark "Script Index". To view the contents of
each index, click each index item.
Built-in sample scripts located in the "Context menu Items" folder are as follows.
Link URL
Opens the default internet browser and shows the web page which
the URL at the cursor position indicates. This script is using
"Internet Config".
Read Out
Reads out the selected area. You need the "English/Japanese Text-
to-Speech" system to be installed. If you select this menu without
having selected any text area, the whole document will be read out.
Open dictionary
Opens the dictionary application in the Word Service menu and look up
the selected word in the dictionary.
Check Spelling
Checks spellings of the selected text area. To use this script, you
need to register some spell checker in the "Word Services" of the
menu "Tools".
Default Style
Resets styles (fonts, sizes, colors and faces) of the selected area to
the default.
Built-in sample scripts located in the "Droplet Samples" folder are as follows.
To Mac Text
If you drop text files of other OS onto this droplet, the files will be
converted into MacOS text (CR line break) files. If it is the
Japanese text, the kanji encoding will also be converted into Shift-JIS
(MacJapanese) encoding.
To Dos Text
If you drop text files onto this droplet, the files will be converted
into DOS text (CR+LF line break) files. If it is the Japanese text,
the kanji encoding will also be converted into Shift-JIS encoding.
To Unix(EUC) Text
If you drop text files onto this droplet, the files will be
converted into Unix text (LF line break) files. If it is the Japanese
text, the kanji encoding will also be converted into EUC encoding.
To Unix(JIS) Text
If you drop text files onto this droplet, the files will be converted
into Unix text (LF line break) files. If it is the Japanese text, the
kanji encoding will also be converted into JIS encoding.
To Unicode
If you drop text files onto this droplet, the files will be converted
into Unicode text files. You need the "Text Encoding Converter" to be
installed in the System Folder.
To UTF8
If you drop text files onto this droplet, the files will be converted
into Unicode UTF8 text files. You need the "Text Encoding Converter"
to be installed in the System Folder.
Read Out
If you drop text file on this droplet, the contents of the file will be
read out. To use this, you need the "English/Japanese Text-to-
Speech" system to be installed.
Zenkaku Eisu to Hankaku
If you drop text files on this droplet, all zenkaku alphanumerics in
the files will be converted to the hankaku characters. This droplet
can work only in the Japanese MacOS.
Hankaku Kana to Zenkaku
If you drop text files on this droplet, all the hankaku katakanas in the
files will be converted to the zenkaku katakanas. This droplet can